﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        public int[] SortArray(int[] arr)
        {
            Array.Sort(arr);
            return arr;
        }

        public int[] ReverseArray(int[] arr)
        {
            Array.Reverse(arr);
            return arr;
        }


        private void button1_Click(object sender, EventArgs e)
        {
            int[] arr = new int[10];
            String str1 = "";
            String str2 = "";

            arr[0] = 3;
            arr[1] = 6;
            arr[2] = 5;
            arr[3] = 1;
            arr[4] = 2;
            arr[5] = 7;
            arr[6] = 4;
            arr[7] = 9;
            arr[8] = 10;
            arr[8] = 8;
            SortArray(arr);
            for(int i= 0;i < 10 ;i++)
            {
            str1 = str1 + Convert.ToString(arr[i]+" ");
            }
            textBox1.Text = str1;

            ReverseArray(arr);
            for (int i = 0; i < 10; i++)
            {
                str2 = str2 + Convert.ToString(arr[i] + " ");
            }
            textBox2.Text = str2;
        }
    }
}
